package com.mopon.clean;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class WinCmdTest {

	@SuppressWarnings("unused")
	public static void main(String[] args) throws IOException, InterruptedException {
		String cmd = "cmd /c rd /s/q d:\\usr\\local\\mopon\\card_data\\0001\\2";
		String[] param_array = cmd.split("[\\s]+");
		ProcessBuilder pb = new ProcessBuilder(param_array);
		Process process = pb.start();
		int exitCode = process.waitFor();
		
		InputStream is = process.getInputStream();
		InputStreamReader isr = new InputStreamReader(is, "GBK");
		BufferedReader br = new BufferedReader(isr);
		String line;
		StringBuilder sb = new StringBuilder();

		while ((line = br.readLine()) != null) {
			System.out.println(line);
			sb.append(line);
		}
		is.close();
		isr.close();
		br.close();
		
	}

}
